import unittest

import testbaidu1
import testbaidu2
import 封装的测试报告类


def createsuite():
    # addTest->一个一个添加

    suite = unittest.TestSuite()
    # suite.addTest(testbaidu1.Baidu1("test_hao"))
    # suite.addTest(testbaidu1.Baidu1("test_hbaidu"))
    suite.addTest(testbaidu2.Baidu2("test_1hao"))
    # suite.addTest(testbaidu2.Baidu2("test_baidusearch"))
    return suite

    # makesuite
    # suite = unittest.TestSuite()
    # suite.addTest(unittest.makeSuite(testbaidu1.Baidu1))
    # suite.addTest(unittest.makeSuite(testbaidu2.Baidu2))
    # return suite

    # TestLoader
    # suite1 = unittest.TestLoader().loadTestsFromTestCase(testbaidu1.Baidu1)
    # suite2 = unittest.TestLoader().loadTestsFromTestCase(testbaidu2.Baidu2)
    # suite = unittest.TestSuite([suite1, suite2])
    # return suite

    # discover
    # discover = unittest.defaultTestLoader.discover("../src0716", pattern="testbaidu*.py", top_level_dir=None)
    # return discover


if __name__ == "__main__":
    # suite = createsuite()
    # runner = unittest.TextTestRunner(verbosity=2)
    # runner.run(suite)
    封装的测试报告类.tools().reportIt(createsuite)
